{% load i18n %}
{% load staticfiles %}
{% if entries %}
<div class="slider-container">
  <div class="slider">
    <ul class="slides">
      {% for entry in entries %}
      <li class="slide slide-{{ forloop.counter }}">
        <a href="{{ entry.get_absolute_url }}" title="{{ entry.title }}">
          <img src="{% if entry.image %}{{ entry.image.url }}{% endif %}" alt="{{ entry.title }}" />
        </a>
        <div class="slide-content">
          <h2>
            <a href="{{ entry.get_absolute_url }}" rel="bookmark"
               title="{{ entry.title }}">{{ entry.title }}</a>
          </h2>
          {{ entry.excerpt|safe|linebreaks|truncatewords_html:30 }}
        </div>
      </li>
      {% endfor %}
    </ul>
  </div>
</div>
<script type="text/javascript" src="{% static "zinnia/theme/js/jquery.js" %}"></script>
<script type="text/javascript" src="{% static "zinnia/theme/js/jquery.flexslider.js" %}"></script>
<script type="text/javascript">
  jQuery(window).load(function() {
    jQuery(".slider").flexslider({
           controlsContainer: ".slider",
           animation: "fade",
           slideshow: true,
           directionNav: true,
           controlNav: true,
           pauseOnHover: true,
           slideshowSpeed: 7000,
           animationDuration: 600
    });
  });
</script>
{% endif %}
